import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/page/home'
import Main from '@/page/main'
import Test from '@/layout/test'
import { admin } from './admin'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      component: Home
    },
    // needLogin判断是否需要登录才可以进入
    {
      path: '/home',
      components: {
        default: Home
      }
      // meta: {
      //   needLogin: true
      // }
    },
    {
      path: '/main',
      name: 'main',
      components: {
        default: Main
      },
      children: [
        {
          name: 'test',
          path: 'test',
          component: Test
        }
        // {
        //   name: 'test',
        //   path: 'test',
        //   component: Test
        // }
      ]
    },
    // {
    //   path: '/test',
    //   components: {
    //     default: Test
    //   }
    // },
    ...admin
  ]
})
